package cn.com.epicc.wap.epe.product.controller;

import cn.com.epicc.wap.epe.common.result.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * Description: 产品元素控制层
 * Author: lishangmin
 * Created: 2018-06-07 09:54
 */
@Api("产品元素API")
@RestController
@RequestMapping("/element")
public class ElementController {

    @ApiOperation("产品元素添加")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "productKey", value = "产品主键" , required = true, paramType = "form"),
            @ApiImplicitParam(name = "elementCode", value = "元素代码" , required = true, paramType = "form"),
            @ApiImplicitParam(name = "sid", value = "主键" , required = true, paramType = "form")
    })
    @RequestMapping(value = "/add" , method = RequestMethod.POST)
    public Result add(
            @RequestParam(value = "productKey")String productKey,
            @RequestParam(value = "elementCode")String elementCode,
            @RequestParam(value = "sid")String sid

    ){
        return Result.success();
    }

    @ApiOperation("产品元素修改")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "sid", value = "主键" , required = true, paramType = "form"),
            @ApiImplicitParam(name = "textCode", value = "内容ID" , required = true, paramType = "form"),
            @ApiImplicitParam(name = "text", value = "内容" , required = true, paramType = "form"),
            @ApiImplicitParam(name = "sort", value = "排序" , required = true, paramType = "form"),
    })
    @RequestMapping(value = "/edit",method = RequestMethod.POST)
    public Result edit(
            @RequestParam(value = "sid")String sid,
            @RequestParam(value = "textCode")String textCode,
            @RequestParam(value = "text")String text,
            @RequestParam(value = "sort")String sort
    ){
        return Result.success();
    }

    @ApiOperation("产品元素删除")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "sid", value = "主键" , required = true, paramType = "form"),
    })
    @RequestMapping(value = "/delete",method = RequestMethod.POST)
    public Result delete(
            @RequestParam(value = "sid")String sid
    ){
        return Result.success();
    }
}
